package channel

const ovData = "data"

type Settings struct {
	Addr      string `md:"addr" json:"addr,omitempty"`
	DB        int    `md:"db" json:"db,omitempty"`
	Password  string `md:"password" json:"password,omitempty"`
	KeyPrefix string `md:"keyPrefix" json:"keyPrefix,omitempty"`
	Sub       string `md:"sub" json:"sub"`
}

type HandlerSettings struct {
}

type Output struct {
	Data interface{} `md:"data"` // The data pulled from the channel
}

func (o *Output) ToMap() map[string]interface{} {
	return map[string]interface{}{
		ovData: o.Data,
	}
}

func (o *Output) FromMap(values map[string]interface{}) error {
	o.Data = values[ovData]
	return nil
}
